var CryptoJS = require("crypto-js");
        var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
          , _p = "W5D80NFZHAYB8EUI2T649RT2MNRMVE2O";
        function e2(e) {
            if (null == (e = _u_e(e)))
                return null;
            for (var t = "", n = 0; n < e.length; n++) {
                var r = _p.charCodeAt(n % _p.length);
                t += String.fromCharCode(e.charCodeAt(n) ^ r)
            }
            return t
        }
         function _u_e(e) {
            if (null == e)
                return null;
            e = e.replace(/\r\n/g, "\n");
            for (var t = "", n = 0; n < e.length; n++) {
                var r = e.charCodeAt(n);
                r < 128 ? t += String.fromCharCode(r) : r > 127 && r < 2048 ? (t += String.fromCharCode(r >> 6 | 192),
                t += String.fromCharCode(63 & r | 128)) : (t += String.fromCharCode(r >> 12 | 224),
                t += String.fromCharCode(r >> 6 & 63 | 128),
                t += String.fromCharCode(63 & r | 128))
            }
            return t
        }

        function e1(e) {
            if (null == e)
                return null;
            for (var t, n, r, o, i, a, l, s = "", c = 0; c < e.length; )
                o = (t = e.charCodeAt(c++)) >> 2,
                i = (3 & t) << 4 | (n = e.charCodeAt(c++)) >> 4,
                a = (15 & n) << 2 | (r = e.charCodeAt(c++)) >> 6,
                l = 63 & r,
                isNaN(n) ? a = l = 64 : isNaN(r) && (l = 64),
                s = s + _keyStr.charAt(o) + _keyStr.charAt(i) + _keyStr.charAt(a) + _keyStr.charAt(l);
            return s
        }

         function d1(e) {
            var t, n, r, o, i, a, l = "", s = 0;
            for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); s < e.length; )
                t = _keyStr.indexOf(e.charAt(s++)) << 2 | (o = _keyStr.indexOf(e.charAt(s++))) >> 4,
                n = (15 & o) << 4 | (i = _keyStr.indexOf(e.charAt(s++))) >> 2,
                r = (3 & i) << 6 | (a = _keyStr.indexOf(e.charAt(s++))),
                l += String.fromCharCode(t),
                64 != i && (l += String.fromCharCode(n)),
                64 != a && (l += String.fromCharCode(r));
            return l
        }
      function _u_d(e) {
            for (var t = "", n = 0, r = 0, o = 0, i = 0; n < e.length; )
                (r = e.charCodeAt(n)) < 128 ? (t += String.fromCharCode(r),
                n++) : r > 191 && r < 224 ? (o = e.charCodeAt(n + 1),
                t += String.fromCharCode((31 & r) << 6 | 63 & o),
                n += 2) : (o = e.charCodeAt(n + 1),
                i = e.charCodeAt(n + 2),
                t += String.fromCharCode((15 & r) << 12 | (63 & o) << 6 | 63 & i),
                n += 3);
            return t
        }
    function d2(e) {
            for (var t = "", n = 0; n < e.length; n++) {
                var r = _p.charCodeAt(n % _p.length);
                t += String.fromCharCode(e.charCodeAt(n) ^ r)
            }
            return t = _u_d(t)
        }
payload = {
    "libraryId": 33,
    "sectionId": 208,
    "filterConfigIds": [
        271,
        269,
        270,
        1404,
        889,
        305,
        272,
        266,
        1825,
        267,
        268,
        1162
    ],
    "queryParam": {
        "start": 0,
        "limit": 20,
        "searchFieldIds": null,
        "is_oversea": [
            "1",
            "2",
            "3",
            "4"
        ],
        "query_field_ids": null
    }
}
        // console.log(CryptoJS.MD5(f+_p).toString().toUpperCase())
//   var  d_payload_str = JSON.stringify(payload)
// var f = e1(e2(d_payload_str))
// console.log( CryptoJS.MD5(f+_p).toString().toUpperCase())
     function get_data(d_payload){
           var  d_payload_str = JSON.stringify(d_payload)
           var f = e1(e2(d_payload_str))
           var sign = CryptoJS.MD5(f+_p).toString().toUpperCase()

         return {
            "payload": f,
            "v": 1,
            "sig": sign
        }
        }
     function parse_d(d){
          return JSON.parse(d2(d1(d)))
        }

